package com.wang.springframework.beans.factory.support;

import com.wang.springframework.beans.BeansException;
import com.wang.springframework.beans.factory.config.BeanDefinition;

import java.lang.reflect.Constructor;

/**
 * @author wangjianhua
 * @Description 实例化策略
 * @date 2021/8/24/024 14:31
 **/
public interface InstantiationStrategy {

    /**
     * bean实例化
     * @param beanDefinition  beanDefinition
     * @param beanName bean名称
     * @param constructor 构造器
     * @param args 参数
     * @return bean
     * @throws BeansException 异常
     */
    Object instantiate(BeanDefinition beanDefinition, String beanName, Constructor<?> constructor,Object[] args) throws BeansException;
}
